#include "StdAfx.h"
#include "ReverberationXAPO.h"

ReverberationXAPO::ReverberationXAPO(IXAudio2SourceVoice* pVoice, WAVEFORMATEXTENSIBLE* pwfx):EffectXAPO(pVoice, pwfx)
{
	CreateFX(__uuidof(FXReverb),&pXAPO);
	
	IXAudio2SourceVoice* pSourceVoice = pVoice;

	XAPOParameters.Diffusion = FXREVERB_DEFAULT_DIFFUSION;
	XAPOParameters.RoomSize = FXREVERB_DEFAULT_ROOMSIZE;	
}

ReverberationXAPO::~ReverberationXAPO(void)
{
}


HRESULT ReverberationXAPO::apply(void)
{

	pSourceVoice->SetEffectParameters( GetEffectNumber(), &XAPOParameters, sizeof( FXREVERB_PARAMETERS ) );

	
	
	return S_OK;
}



FXREVERB_PARAMETERS ReverberationXAPO::GetReverbParameters(void)
{
	return XAPOParameters;
}

FXREVERB_PARAMETERS ReverberationXAPO::SetReverbParameters(FXREVERB_PARAMETERS& NewXAPOParameters)
{
	FXREVERB_PARAMETERS OldXAPOParameters = XAPOParameters;
	XAPOParameters = NewXAPOParameters;

	return OldXAPOParameters;

}